package com.shujia.hdfs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import java.io.IOException;


public class HdfsHa {
    public static void main(String[] args) throws IOException {


        //hadoop配置文件对象
        Configuration configuration = new Configuration();

        //增加外部配置文件
        configuration.addResource("hadoop/ha/core-site.xml");
        configuration.addResource("hadoop/ha/hdfs-site.xml");


        //创建FileSystem对象

        FileSystem fileSystem = FileSystem.get(configuration);

        fileSystem.mkdirs(new Path("/c"));
    }
}
